#pragma once
#include "thread.h"
#include <afxcmn.h>

class FileTransferThread :
	public Thread
{
public:
	FileTransferThread(void);
	~FileTransferThread(void);
	virtual void Worker() = 0;
	void SetDataSock(SOCKET socket) { m_nSocket = socket; }
	void SetFilePointer(FILE *file) { m_pf = file; }
	void SetProgressBar(CProgressCtrl *pPCtrl, int fileSize);
	void SetProgressBar(CProgressCtrl *pPCtrl);
	void SetProgressBar(int fileSize);

protected:
	void Close(void);
	SOCKET m_nSocket;
	FILE *m_pf;
	bool m_bStor;
	char m_cFileBuf[4096 + 1];
	int m_nReadByte;
	uint m_nTotalByte;
	int m_nAccuByte;
	CProgressCtrl *m_pkProgressCtrl;
};

